package com.mitei.fwk.ihm;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;

public abstract class AbstractIHMMainFrame extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private JPanel frameContentPane = new JPanel();
	private Object frameLayout = new Object();
	private String frameTitle = new String();
	@SuppressWarnings("unused")
	private Object parent = null;
	
	public AbstractIHMMainFrame(String frameTitle) {
		super(frameTitle);
		
		AbstractIHMMainFrame.setSystemLookAndFeel();
		this.setVisible(true);
		this.pack();
		this.setLocation(200,200);
		this.setDefaultCloseOperation(EXIT_ON_CLOSE);
	}
	
	public AbstractIHMMainFrame(String frameTitle, Object parent) {
		super(frameTitle);
		this.parent = parent;
		
		AbstractIHMMainFrame.setSystemLookAndFeel();
		this.setVisible(true);
		this.pack();
		this.setLocation(200,200);
		this.setDefaultCloseOperation(EXIT_ON_CLOSE);
	}
	
	protected static void setSystemLookAndFeel() {
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} 
		catch (Exception exc) {
			System.err.println("Error loading L&F: " + exc);
		}
	}

	public JPanel getFrameContentPane() {
		return frameContentPane;
	}

	public void setFrameContentPane(JPanel frameContentPane) {
		this.frameContentPane = frameContentPane;
	}

	public Object getFrameLayout() {
		return frameLayout;
	}

	public void setFrameLayout(Object frameLayout) {
		this.frameLayout = frameLayout;
	}

	public String getFrameTitle() {
		return frameTitle;
	}

	public void setFrameTitle(String frameTitle) {
		this.frameTitle = frameTitle;
	}


}
